package edu.caece.langprocessor.syntax.parse;

import java.util.ArrayList;
import java.util.Map;
import java.util.Stack;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import edu.caece.langprocessor.lexical.LexicalProcessor;
import edu.caece.langprocessor.syntax.ProductionFactory;
import edu.caece.langprocessor.syntax.Terminal;
import edu.caece.langprocessor.syntax.tree.Tree;

public class AcceptAction extends Action {

	private static final Log LOGGER = LogFactory.getLog(AcceptAction.class);
	
	public AcceptAction(Integer value){
		this.type = ActionType.accept;
		this.value = value;
	}

	@Override
	public ActionResult run(LexicalProcessor lexicalProcessor,
			Map<Integer, ProductionFactory> productions, 
			GotoActionsTable gotoActionsTable,
			Stack<ParseStackItem> parseStack, Terminal terminalItem, 
			Tree parseTree) {
			if (LOGGER.isInfoEnabled())
				LOGGER.info("Accept action applied.");
		return new ActionResult(terminalItem, null, 0, new ArrayList<Terminal>());
	}


}
